<!DOCTYPE html>
<div class="cs-header">
    <div class="cs-logo">
        <div class="cs-logo-img"> <img  id="logo" style="width: 50px;height: 50px;"/> </div>
        <h1 class="cs-logo-title" id="cs-logo-title" ><span id = "logoTitle"></span></h1>
    </div>
    <div class="cs-user">
        <div class="cs-user-btnbar">
            <a class="cs-btn-logout" id ="loginOut"  title="退出登录"></a>
            <!-- <a class="cs-btn-set" href="#org_personalCtrl" title="个人设置"></a>-->
        </div>
        <div class="cs-user-info">
            <input type="hidden" name="userInfo" id="home_web_userInfo">
            <input type="hidden" name="deptInfo" id="home_web_deptInfo">
            <input type="hidden" name="userCode" id="home_web_userCode">
            <input type="hidden" name="userCode" id="home_web_logOutUrl">
            <i class="cs-user-logo"></i><span class="cs-user-name" id="home_web_userName"></span>
        </div>
    </div>
</div>
<script>
    require(["UtilDir/tool"],function(Tool) {
        $.ajax({
            url: getServer()+"/platform/initHome",
            success: function (data) {
                $("#logoTitle").html("场地及区划数据采集子系统");
                $("#logo").attr("src",data.logo);
                $("#home_web_userInfo").val(JSON.stringify(data.user));
                $("#home_web_deptInfo").val(JSON.stringify(data.mainDept));
                $("#home_web_userName").text(data.user.userName);
                $("#home_web_logOutUrl").val(data.logOutUrl);

            }
        });

        $("#loginOut").click(function () {
            window.location.href = getServer()+ "/sys/logOut?logOutRedirectUrl="+window.location.href;
            /*window.location.href = getServer()+logOutUrl;*/
        });
    });

    var jumpToWithId = function(type, id) {
        // Util.alert('jumpToWithId');
        debugger;
        switch (type) {
            case 1:
                window.location.href = '/platform/home#qhDrillOverviewCtrl';
                break;
            case 2:
                window.location.href = '/platform/home#qhDrillHistogramCtrl';
                break;
            case 3:
                window.location.href = '/platform/home#qhStandardPenetrationCtrl';
                break;
            case 4:
                window.location.href = '/platform/home#qhSituShearWaveCtrl';
                break;
            case 5:
                window.location.href = '/platform/home#qhSoilDynamicCtrl';
                break;
            case 6:
                window.location.href = '/platform/home#qhSeismicFortificationCtrl';
                break;
        }

        window.sessionStorage.setItem("drillJumpId", id);
    }
</script>
